<?php
require_once( 'path.php' );

//调用初始化页面
require_once( CLASSMATE_ROOT.'/controller/display_script_init.php' );
require_once( CLASSMATE_ROOT.'/include/function/mongo_connect.function.php' );


if( !session::get('is_online') ){
	
	$response_message = array( 'type'=>'notice' , 
			'content'=>'您还没有登录，不能进行此操作。' ,
			'url_des'=>'登录去' ,
			'url'=>'/classmate/controller/account/login.php' );
			
	session::set( 'response_message' , $response_message );
	header( 'Location: ../response_message.php' );
	exit();
}


$db_connect = mongo_connect();

$db_obj_user_profile = new db_obj_user_profile( $db_connect );
$db_obj_user = new db_obj_user( $db_connect );

$db_obj_user->load( 'email' , session::get( 'email' ) );
$db_obj_user_profile->load( 'email' , session::get( 'email' ) );

$tpl->assign( 'head_url' , $db_obj_user_profile->get( 'head_url' ) );

$tpl->assign( 'title' , '更新用户头像' );
$tpl->display( 'account/update_user_head_img.tpl' );

